"use strict"

/**
 * 广西南宁市国税爬虫
 *  
 */

var Base = require("./base");
var nn_spider = new Base();
nn_spider.name = "广西南宁市国税局";
nn_spider.page = 1;
nn_spider.contentType = "text";

nn_spider.getPageUrl = function (pg) {
    return "http://nn.gxgs.gov.cn/col/col100705/index.html";
};

nn_spider.getItems = function (data) {
    var reg = new RegExp("<a href=\\\\'([\\s\\S]*?)\\\\'[\\s\\S]+?title=\\\\'([\\s\\S]*?)\\\\'", "ig");
    var regv, items = [];
    while (regv = reg.exec(data)) {
        var url = regv[1];
        var title = regv[2];
        var item = {};
        item.title = title;
        item.url = "http://nn.gxgs.gov.cn" + url;
        item.source = nn_spider.name;
        items.push(item);
    }
    return items;
};

exports = module.exports = nn_spider;